package com.wentao.mall.mapper;

import com.wentao.mall.model.po.Cart;
import com.wentao.mall.model.po.CartExample;
import java.util.List;

import com.wentao.mall.model.vo.CartVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface CartMapper {
    long countByExample(CartExample example);

    int deleteByExample(CartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    List<Cart> selectByExample(CartExample example);

    Cart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByExample(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    List<CartVo> selectCartVoByUserId(Integer userId);

    Cart selectByProductIdAndUserId(Integer productId,Integer userId);

    int updateByIDAndCount(Integer id, Integer count);

    int updateToCount(Integer productId, Integer userId, Integer count);

    int deleteByUserIdAndProductId(Integer productId, Integer userId);

    int updateBySelected(Integer productId, Integer selected, Integer userId);

    void selectAll(Integer selected, Integer userId);
}